package com.biscuit.page.basicservice.service;

import com.biscuit.common.base.BaseResponse;
import com.biscuit.page.basicservice.api.model.response.common.NicknameAResp;
import com.biscuit.page.basicservice.api.model.response.open_common.GeneratePublicPrivateKeyAResp;
import com.biscuit.page.basicservice.utils.BaseResponseUtil;
import com.biscuit.page.basicservice.utils.SecurityUtil;
import com.biscuit.page.basicservice.utils.TextUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author biscuit
 * @createTime 2024/5/17 10:10
 */
@Slf4j
@Service
public class OpenCommonService {



    public BaseResponse<NicknameAResp> generateNickname() {
        NicknameAResp response = new NicknameAResp();
        response.setNickname(TextUtil.getRandomNickname());
        return BaseResponseUtil.success(response);
    }

    public BaseResponse<GeneratePublicPrivateKeyAResp> generatePublicPrivateKey() {
        return BaseResponseUtil.success(SecurityUtil.generatePublicPrivateKey());
    }
}
